# ~*~ coding: utf-8 ~*~
from flask_wtf import FlaskForm
from wtforms import StringField

from apps.common.form import ErrorFormMinx

__all__ = ['FilterForm']


class FilterForm(ErrorFormMinx, FlaskForm):
    project_id = StringField()
    filename = StringField()
    content = StringField()

    class Meta:
        csrf = True

    @property
    def data(self):
        return {
            'project_id': self.project_id.data,
            'filename': self.filename.data,
            'content': self.content.data,
        }
